const { defineConfig } = require('@vue/cli-service')

// console.log('Proxy configuration is being applied...')

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  publicPath: '/bang/',
  devServer: {
    proxy: {
      '/api': {
        target: "http://139.9.106.208:9060/bang",
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        },
        // onProxyRes(proxyRes) {
        //   console.log('Proxy response received:', proxyRes);
        // },
        // logLevel: 'debug'
      }
    }
  }
})



/*nginx配置文件中加“     
    # 代理 API 请求
    location /api {
      proxy_pass http://139.9.106.208:9060/bang;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
  }
”*/